/**
 * 
 */
package br.com.ctm.advogadope.bean;

import javax.enterprise.context.ConversationScoped;
import javax.inject.Inject;
import javax.inject.Named;

import br.com.ctm.advogadope.dao.api.ProcessoDao;
import br.com.ctm.advogadope.model.Processo;
import br.com.ctm.advogadope.negocio.api.ProcessoNegocio;
import br.com.framework.apresentacao.bean.CRUDBean;
import br.jus.cnj.intercomunicacao.beans.ProcessoJudicial;

/**
 * @author Cleber
 *
 */
@Named
@ConversationScoped
public class ProcessoBean extends CRUDBean<Processo, ProcessoDao, ProcessoNegocio>{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private ProcessoJudicial processoJudicial;
	
	
	/**
	 * @param entidadeClass
	 */
	public ProcessoBean() {
		super(Processo.class);
	}

	@Inject
	protected void setNegocio(ProcessoNegocio negocio) {
		super.setNegocio(negocio);
	}
	
	@Override
	protected void beforeOutcomeEdit() {
		processoJudicial = getNegocio().buscarProcessoJudicial(getEntidade().getNpu(), true, null);
		LOGGER.debug("ProvessoJudicial: " + processoJudicial.toString());
		super.beforeOutcomeEdit();
	}

	/**
	 * @return the processoJudicial
	 */
	public ProcessoJudicial getProcessoJudicial() {
		return processoJudicial;
	}

	/**
	 * @param processoJudicial the processoJudicial to set
	 */
	public void setProcessoJudicial(ProcessoJudicial processoJudicial) {
		this.processoJudicial = processoJudicial;
	}

}
